﻿namespace WinForms.ControlList.Sales
{
    using Bll.Comm;
    using Bll.Sales;
    using Bll.Systems;
    using Model.Comm;
    using Model.Sales;
    using Model.Systems;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms;
    using WinForms.Properties;

    public class FrmOrdersVeiw : Form
    {
        private DataGridViewTextBoxColumn AllMoney;
        private DataGridViewTextBoxColumn AllMoneys;
        private DataGridViewTextBoxColumn Amount;
        private DataGridViewTextBoxColumn AmountUnit;
        private DataGridViewTextBoxColumn AmoutMoney;
        private Button btn_Close;
        private DataGridViewTextBoxColumn CommName;
        private DataGridViewTextBoxColumn CommType;
        private IContainer components = null;
        private DataGridView DataGridList;
        private DataGridViewTextBoxColumn Discount;
        private FormHelper fh = new FormHelper();
        public const int HTCAPTION = 2;
        private bool isRun = false;
        private DataGridViewTextBoxColumn IsZs;
        private Label label1;
        private Label lbl_BiTian;
        private Label lbl_CreateTime;
        private Label lbl_CreateTimeValue;
        private Label lbl_GuestId;
        private Label lbl_GuestName;
        private Label lbl_MoneyValue;
        private Label lbl_OrderNum;
        private Label lbl_OrdersNumValue;
        private Label lbl_Remark;
        private Label lbl_RemarkValue;
        private Label lbl_ToMeetMoney;
        private Label lbl_UserId;
        private Label lbl_UserName;
        private Label lblTitle;
        private DataGridViewTextBoxColumn LotNum;
        private int orderId = 0;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Table2;
        private Panel pan_Table3;
        private Panel pan_Table4;
        private Panel pan_td0;
        private Panel pan_td1;
        private Panel pan_td10;
        private Panel pan_td11;
        private Panel pan_td2;
        private Panel pan_td3;
        private Panel pan_td8;
        private Panel pan_td9;
        private Panel pan_Top;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel_BiTian;
        private Panel panel_Button;
        private Panel panel_JianGe;
        private Panel panel1;
        private Panel panel2;
        private Panel panel5;
        private Panel panel9;
        private DataGridViewTextBoxColumn Remark;
        private DataGridViewTextBoxColumn salescommid;
        public const int SC_MOVE = 0xf010;
        private DataGridViewTextBoxColumn StandardMoney;
        public const int WM_SYSCOMMAND = 0x112;

        public FrmOrdersVeiw(int id)
        {
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.orderId = id;
            base.AcceptButton = this.btn_Close;
            UserEnt loginUser = PublicAppliction.LoginUser;
            OrdersEnt model = OrdersBll.GetModel(this.orderId);
            if (model != null)
            {
                this.lbl_OrdersNumValue.Text = model.OrderNum;
                this.lbl_GuestName.Text = model.GuestName;
                this.lbl_MoneyValue.Text = model.ToMeetMoney.ToString("F2");
                this.lbl_RemarkValue.Text = model.Remark;
                UserEnt ent3 = UserBll.GetModel(loginUser.UserId);
                this.lbl_UserName.Text = ent3.UserName;
                this.lbl_CreateTimeValue.Text = model.CreateTime.ToString();
            }
            this.LoadSalesDeticl();
            this.DataGridList.EditMode = DataGridViewEditMode.EditOnEnter;
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.DialogResult = DialogResult.Cancel;
            base.Close();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();
            DataGridViewCellStyle style7 = new DataGridViewCellStyle();
            DataGridViewCellStyle style8 = new DataGridViewCellStyle();
            DataGridViewCellStyle style9 = new DataGridViewCellStyle();
            DataGridViewCellStyle style10 = new DataGridViewCellStyle();
            this.pan_ZhongJian = new Panel();
            this.lblTitle = new Label();
            this.pan_TopRight = new Panel();
            this.pan_DockLeft = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.DataGridList = new DataGridView();
            this.panel5 = new Panel();
            this.pan_Table3 = new Panel();
            this.lbl_CreateTimeValue = new Label();
            this.lbl_UserName = new Label();
            this.lbl_UserId = new Label();
            this.lbl_CreateTime = new Label();
            this.panel2 = new Panel();
            this.panel1 = new Panel();
            this.label1 = new Label();
            this.panel_JianGe = new Panel();
            this.pan_Table4 = new Panel();
            this.pan_td11 = new Panel();
            this.lbl_RemarkValue = new Label();
            this.pan_td10 = new Panel();
            this.lbl_Remark = new Label();
            this.pan_td9 = new Panel();
            this.lbl_MoneyValue = new Label();
            this.pan_td8 = new Panel();
            this.lbl_ToMeetMoney = new Label();
            this.pan_Table2 = new Panel();
            this.pan_td3 = new Panel();
            this.lbl_GuestName = new Label();
            this.pan_td2 = new Panel();
            this.lbl_GuestId = new Label();
            this.pan_td1 = new Panel();
            this.lbl_OrdersNumValue = new Label();
            this.pan_td0 = new Panel();
            this.lbl_OrderNum = new Label();
            this.panel_BiTian = new Panel();
            this.lbl_BiTian = new Label();
            this.panel_Button = new Panel();
            this.btn_Close = new Button();
            this.panel9 = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_Top = new Panel();
            this.pan_TopLeft = new Panel();
            this.salescommid = new DataGridViewTextBoxColumn();
            this.LotNum = new DataGridViewTextBoxColumn();
            this.CommType = new DataGridViewTextBoxColumn();
            this.CommName = new DataGridViewTextBoxColumn();
            this.StandardMoney = new DataGridViewTextBoxColumn();
            this.Discount = new DataGridViewTextBoxColumn();
            this.AmoutMoney = new DataGridViewTextBoxColumn();
            this.Amount = new DataGridViewTextBoxColumn();
            this.AllMoneys = new DataGridViewTextBoxColumn();
            this.AmountUnit = new DataGridViewTextBoxColumn();
            this.Remark = new DataGridViewTextBoxColumn();
            this.IsZs = new DataGridViewTextBoxColumn();
            this.pan_ZhongJian.SuspendLayout();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            ((ISupportInitialize) this.DataGridList).BeginInit();
            this.pan_Table3.SuspendLayout();
            this.panel1.SuspendLayout();
            this.pan_Table4.SuspendLayout();
            this.pan_td11.SuspendLayout();
            this.pan_td10.SuspendLayout();
            this.pan_td9.SuspendLayout();
            this.pan_td8.SuspendLayout();
            this.pan_Table2.SuspendLayout();
            this.pan_td3.SuspendLayout();
            this.pan_td2.SuspendLayout();
            this.pan_td1.SuspendLayout();
            this.pan_td0.SuspendLayout();
            this.panel_BiTian.SuspendLayout();
            this.panel_Button.SuspendLayout();
            this.pan_Top.SuspendLayout();
            base.SuspendLayout();
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.lblTitle);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x36c, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_ZhongJian.MouseDown += new MouseEventHandler(this.pan_ZhongJian_MouseDown);
            this.lblTitle.AutoSize = true;
            this.lblTitle.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.lblTitle.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lblTitle.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.lblTitle.Location = new Point(6, 8);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x69, 13);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "浏览茶叶销售单";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x38b, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0x207);
            this.pan_DockLeft.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x390, 0x207);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(910, 0x206);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.DataGridList);
            this.pan_AllPlanes.Controls.Add(this.panel5);
            this.pan_AllPlanes.Controls.Add(this.pan_Table3);
            this.pan_AllPlanes.Controls.Add(this.panel2);
            this.pan_AllPlanes.Controls.Add(this.panel1);
            this.pan_AllPlanes.Controls.Add(this.panel_JianGe);
            this.pan_AllPlanes.Controls.Add(this.pan_Table4);
            this.pan_AllPlanes.Controls.Add(this.pan_Table2);
            this.pan_AllPlanes.Controls.Add(this.panel_BiTian);
            this.pan_AllPlanes.Controls.Add(this.panel_Button);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(890, 0x1f2);
            this.pan_AllPlanes.TabIndex = 4;
            this.DataGridList.AllowUserToAddRows = false;
            this.DataGridList.AllowUserToDeleteRows = false;
            style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style.BackColor = Color.FromArgb(0xf9, 0xf9, 0xf9);
            this.DataGridList.AlternatingRowsDefaultCellStyle = style;
            this.DataGridList.BackgroundColor = Color.WhiteSmoke;
            this.DataGridList.BorderStyle = BorderStyle.None;
            style2.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style2.BackColor = Color.White;
            style2.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style2.ForeColor = SystemColors.WindowText;
            style2.SelectionBackColor = SystemColors.Highlight;
            style2.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.ColumnHeadersDefaultCellStyle = style2;
            this.DataGridList.Columns.AddRange(new DataGridViewColumn[] { this.salescommid, this.LotNum, this.CommType, this.CommName, this.StandardMoney, this.Discount, this.AmoutMoney, this.Amount, this.AllMoneys, this.AmountUnit, this.Remark, this.IsZs });
            style3.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style3.BackColor = SystemColors.Window;
            style3.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style3.ForeColor = SystemColors.ControlText;
            style3.SelectionBackColor = SystemColors.Highlight;
            style3.SelectionForeColor = SystemColors.HighlightText;
            style3.WrapMode = DataGridViewTriState.False;
            this.DataGridList.DefaultCellStyle = style3;
            this.DataGridList.Dock = DockStyle.Fill;
            this.DataGridList.EnableHeadersVisualStyles = false;
            this.DataGridList.GridColor = Color.FromArgb(0xab, 0xb9, 0x9d);
            this.DataGridList.Location = new Point(0, 110);
            this.DataGridList.Name = "DataGridList";
            style4.Alignment = DataGridViewContentAlignment.BottomCenter;
            style4.BackColor = Color.White;
            style4.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style4.ForeColor = SystemColors.WindowText;
            style4.SelectionBackColor = SystemColors.Highlight;
            style4.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.RowHeadersDefaultCellStyle = style4;
            style5.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.DataGridList.RowsDefaultCellStyle = style5;
            this.DataGridList.RowTemplate.Height = 0x17;
            this.DataGridList.Size = new Size(890, 0x12f);
            this.DataGridList.TabIndex = 0x12;
            this.panel5.Dock = DockStyle.Bottom;
            this.panel5.Location = new Point(0, 0x19d);
            this.panel5.Name = "panel5";
            this.panel5.Size = new Size(890, 5);
            this.panel5.TabIndex = 0x11;
            this.pan_Table3.Controls.Add(this.lbl_CreateTimeValue);
            this.pan_Table3.Controls.Add(this.lbl_UserName);
            this.pan_Table3.Controls.Add(this.lbl_UserId);
            this.pan_Table3.Controls.Add(this.lbl_CreateTime);
            this.pan_Table3.Dock = DockStyle.Bottom;
            this.pan_Table3.Location = new Point(0, 0x1a2);
            this.pan_Table3.Name = "pan_Table3";
            this.pan_Table3.Size = new Size(890, 0x1b);
            this.pan_Table3.TabIndex = 0x10;
            this.pan_Table3.Paint += new PaintEventHandler(this.pan_Table3_Paint);
            this.lbl_CreateTimeValue.AutoSize = true;
            this.lbl_CreateTimeValue.Location = new Point(0x268, 7);
            this.lbl_CreateTimeValue.Name = "lbl_CreateTimeValue";
            this.lbl_CreateTimeValue.Size = new Size(0x29, 12);
            this.lbl_CreateTimeValue.TabIndex = 2;
            this.lbl_CreateTimeValue.Text = "label7";
            this.lbl_UserName.AutoSize = true;
            this.lbl_UserName.Location = new Point(0xd4, 7);
            this.lbl_UserName.Name = "lbl_UserName";
            this.lbl_UserName.Size = new Size(0x29, 12);
            this.lbl_UserName.TabIndex = 1;
            this.lbl_UserName.Text = "label6";
            this.lbl_UserId.Location = new Point(0x7a, 7);
            this.lbl_UserId.Name = "lbl_UserId";
            this.lbl_UserId.Size = new Size(0x54, 12);
            this.lbl_UserId.TabIndex = 0;
            this.lbl_UserId.Text = "销售人员:";
            this.lbl_UserId.TextAlign = ContentAlignment.MiddleRight;
            this.lbl_CreateTime.Location = new Point(0x20e, 7);
            this.lbl_CreateTime.Name = "lbl_CreateTime";
            this.lbl_CreateTime.Size = new Size(0x54, 12);
            this.lbl_CreateTime.TabIndex = 0;
            this.lbl_CreateTime.Text = "销售时间:";
            this.lbl_CreateTime.TextAlign = ContentAlignment.MiddleRight;
            this.panel2.Dock = DockStyle.Bottom;
            this.panel2.Location = new Point(0, 0x1bd);
            this.panel2.Name = "panel2";
            this.panel2.Size = new Size(890, 5);
            this.panel2.TabIndex = 7;
            this.panel1.Controls.Add(this.label1);
            this.panel1.Dock = DockStyle.Top;
            this.panel1.Location = new Point(0, 0x55);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(890, 0x19);
            this.panel1.TabIndex = 6;
            this.panel1.Paint += new PaintEventHandler(this.panel1_Paint);
            this.label1.AutoSize = true;
            this.label1.Location = new Point(10, 6);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x35, 12);
            this.label1.TabIndex = 0;
            this.label1.Text = "销售信息";
            this.panel_JianGe.Dock = DockStyle.Top;
            this.panel_JianGe.Location = new Point(0, 0x4b);
            this.panel_JianGe.Name = "panel_JianGe";
            this.panel_JianGe.Size = new Size(890, 10);
            this.panel_JianGe.TabIndex = 3;
            this.pan_Table4.Controls.Add(this.pan_td11);
            this.pan_Table4.Controls.Add(this.pan_td10);
            this.pan_Table4.Controls.Add(this.pan_td9);
            this.pan_Table4.Controls.Add(this.pan_td8);
            this.pan_Table4.Dock = DockStyle.Top;
            this.pan_Table4.Location = new Point(0, 50);
            this.pan_Table4.Name = "pan_Table4";
            this.pan_Table4.Size = new Size(890, 0x19);
            this.pan_Table4.TabIndex = 0;
            this.pan_td11.Controls.Add(this.lbl_RemarkValue);
            this.pan_td11.Dock = DockStyle.Left;
            this.pan_td11.Location = new Point(610, 0);
            this.pan_td11.Name = "pan_td11";
            this.pan_td11.Size = new Size(280, 0x19);
            this.pan_td11.TabIndex = 0;
            this.pan_td11.Paint += new PaintEventHandler(this.pan_td11_Paint);
            this.lbl_RemarkValue.AutoSize = true;
            this.lbl_RemarkValue.Location = new Point(6, 5);
            this.lbl_RemarkValue.Name = "lbl_RemarkValue";
            this.lbl_RemarkValue.Size = new Size(0x29, 12);
            this.lbl_RemarkValue.TabIndex = 0;
            this.lbl_RemarkValue.Text = "label5";
            this.pan_td10.Controls.Add(this.lbl_Remark);
            this.pan_td10.Dock = DockStyle.Left;
            this.pan_td10.Location = new Point(450, 0);
            this.pan_td10.Name = "pan_td10";
            this.pan_td10.Size = new Size(160, 0x19);
            this.pan_td10.TabIndex = 1;
            this.pan_td10.Paint += new PaintEventHandler(this.pan_td10_Paint);
            this.lbl_Remark.Location = new Point(0x3e, 5);
            this.lbl_Remark.Name = "lbl_Remark";
            this.lbl_Remark.Size = new Size(0x54, 12);
            this.lbl_Remark.TabIndex = 0;
            this.lbl_Remark.Text = "备注:";
            this.lbl_Remark.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td9.Controls.Add(this.lbl_MoneyValue);
            this.pan_td9.Dock = DockStyle.Left;
            this.pan_td9.Location = new Point(170, 0);
            this.pan_td9.Name = "pan_td9";
            this.pan_td9.Size = new Size(280, 0x19);
            this.pan_td9.TabIndex = 2;
            this.pan_td9.Paint += new PaintEventHandler(this.pan_td9_Paint);
            this.lbl_MoneyValue.AutoSize = true;
            this.lbl_MoneyValue.Location = new Point(6, 5);
            this.lbl_MoneyValue.Name = "lbl_MoneyValue";
            this.lbl_MoneyValue.Size = new Size(0x29, 12);
            this.lbl_MoneyValue.TabIndex = 0;
            this.lbl_MoneyValue.Text = "label3";
            this.pan_td8.Controls.Add(this.lbl_ToMeetMoney);
            this.pan_td8.Dock = DockStyle.Left;
            this.pan_td8.Location = new Point(0, 0);
            this.pan_td8.Name = "pan_td8";
            this.pan_td8.Size = new Size(170, 0x19);
            this.pan_td8.TabIndex = 3;
            this.pan_td8.Paint += new PaintEventHandler(this.pan_td8_Paint);
            this.lbl_ToMeetMoney.Location = new Point(0x3e, 5);
            this.lbl_ToMeetMoney.Name = "lbl_ToMeetMoney";
            this.lbl_ToMeetMoney.Size = new Size(0x54, 12);
            this.lbl_ToMeetMoney.TabIndex = 0;
            this.lbl_ToMeetMoney.Text = "应收金额:";
            this.lbl_ToMeetMoney.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table2.Controls.Add(this.pan_td3);
            this.pan_Table2.Controls.Add(this.pan_td2);
            this.pan_Table2.Controls.Add(this.pan_td1);
            this.pan_Table2.Controls.Add(this.pan_td0);
            this.pan_Table2.Dock = DockStyle.Top;
            this.pan_Table2.Location = new Point(0, 0x19);
            this.pan_Table2.Name = "pan_Table2";
            this.pan_Table2.Size = new Size(890, 0x19);
            this.pan_Table2.TabIndex = 2;
            this.pan_td3.Controls.Add(this.lbl_GuestName);
            this.pan_td3.Dock = DockStyle.Left;
            this.pan_td3.Location = new Point(610, 0);
            this.pan_td3.Name = "pan_td3";
            this.pan_td3.Size = new Size(280, 0x19);
            this.pan_td3.TabIndex = 0;
            this.pan_td3.Paint += new PaintEventHandler(this.pan_td3_Paint);
            this.lbl_GuestName.AutoSize = true;
            this.lbl_GuestName.Location = new Point(6, 5);
            this.lbl_GuestName.Name = "lbl_GuestName";
            this.lbl_GuestName.Size = new Size(0x29, 12);
            this.lbl_GuestName.TabIndex = 0;
            this.lbl_GuestName.Text = "label4";
            this.pan_td2.Controls.Add(this.lbl_GuestId);
            this.pan_td2.Dock = DockStyle.Left;
            this.pan_td2.Location = new Point(450, 0);
            this.pan_td2.Name = "pan_td2";
            this.pan_td2.Size = new Size(160, 0x19);
            this.pan_td2.TabIndex = 1;
            this.pan_td2.Paint += new PaintEventHandler(this.pan_td2_Paint);
            this.lbl_GuestId.Location = new Point(0x3e, 5);
            this.lbl_GuestId.Name = "lbl_GuestId";
            this.lbl_GuestId.Size = new Size(0x54, 12);
            this.lbl_GuestId.TabIndex = 0;
            this.lbl_GuestId.Text = "销售客户:";
            this.lbl_GuestId.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td1.Controls.Add(this.lbl_OrdersNumValue);
            this.pan_td1.Dock = DockStyle.Left;
            this.pan_td1.Location = new Point(170, 0);
            this.pan_td1.Name = "pan_td1";
            this.pan_td1.Size = new Size(280, 0x19);
            this.pan_td1.TabIndex = 2;
            this.pan_td1.Paint += new PaintEventHandler(this.pan_td1_Paint);
            this.lbl_OrdersNumValue.AutoSize = true;
            this.lbl_OrdersNumValue.Location = new Point(6, 5);
            this.lbl_OrdersNumValue.Name = "lbl_OrdersNumValue";
            this.lbl_OrdersNumValue.Size = new Size(0x29, 12);
            this.lbl_OrdersNumValue.TabIndex = 0;
            this.lbl_OrdersNumValue.Text = "label2";
            this.pan_td0.Controls.Add(this.lbl_OrderNum);
            this.pan_td0.Dock = DockStyle.Left;
            this.pan_td0.Location = new Point(0, 0);
            this.pan_td0.Name = "pan_td0";
            this.pan_td0.Size = new Size(170, 0x19);
            this.pan_td0.TabIndex = 3;
            this.pan_td0.Paint += new PaintEventHandler(this.pan_td0_Paint);
            this.lbl_OrderNum.Location = new Point(0x3e, 5);
            this.lbl_OrderNum.Name = "lbl_OrderNum";
            this.lbl_OrderNum.Size = new Size(0x54, 12);
            this.lbl_OrderNum.TabIndex = 0;
            this.lbl_OrderNum.Text = "销售单据号:";
            this.lbl_OrderNum.TextAlign = ContentAlignment.MiddleRight;
            this.panel_BiTian.Controls.Add(this.lbl_BiTian);
            this.panel_BiTian.Dock = DockStyle.Top;
            this.panel_BiTian.Location = new Point(0, 0);
            this.panel_BiTian.Name = "panel_BiTian";
            this.panel_BiTian.Size = new Size(890, 0x19);
            this.panel_BiTian.TabIndex = 3;
            this.panel_BiTian.Paint += new PaintEventHandler(this.panel_BiTian_Paint);
            this.lbl_BiTian.AutoSize = true;
            this.lbl_BiTian.Location = new Point(10, 6);
            this.lbl_BiTian.Name = "lbl_BiTian";
            this.lbl_BiTian.Size = new Size(0x35, 12);
            this.lbl_BiTian.TabIndex = 0;
            this.lbl_BiTian.Text = "基本信息";
            this.panel_Button.Controls.Add(this.btn_Close);
            this.panel_Button.Dock = DockStyle.Bottom;
            this.panel_Button.Location = new Point(0, 450);
            this.panel_Button.Name = "panel_Button";
            this.panel_Button.Size = new Size(890, 0x2b);
            this.panel_Button.TabIndex = 4;
            this.panel_Button.Paint += new PaintEventHandler(this.panel_Button_Paint);
            this.btn_Close.Location = new Point(0x198, 10);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0x4b, 0x17);
            this.btn_Close.TabIndex = 8;
            this.btn_Close.Text = "关 闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 0x1ed);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(890, 5);
            this.panel9.TabIndex = 3;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(900, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0x1f2);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0x1f2);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x1fc);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(910, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(910, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0x206);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(910, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x38f, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0x207);
            this.pan_DockRight.TabIndex = 1;
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x390, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.pan_TopLeft.MouseDown += new MouseEventHandler(this.pan_TopLeft_MouseDown);
            this.salescommid.HeaderText = "salescommid";
            this.salescommid.Name = "salescommid";
            this.salescommid.Visible = false;
            this.LotNum.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.LotNum.DataPropertyName = "LotNum";
            style6.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style6.BackColor = Color.White;
            this.LotNum.DefaultCellStyle = style6;
            this.LotNum.FillWeight = 150f;
            this.LotNum.HeaderText = "批号";
            this.LotNum.Name = "LotNum";
            this.LotNum.ReadOnly = true;
            this.LotNum.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.CommType.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CommType.DataPropertyName = "CommType";
            style7.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style7.BackColor = Color.White;
            this.CommType.DefaultCellStyle = style7;
            this.CommType.FillWeight = 150f;
            this.CommType.HeaderText = "商品类型";
            this.CommType.Name = "CommType";
            this.CommType.ReadOnly = true;
            this.CommType.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.CommName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CommName.DataPropertyName = "CommName";
            style8.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style8.BackColor = Color.White;
            this.CommName.DefaultCellStyle = style8;
            this.CommName.FillWeight = 150f;
            this.CommName.HeaderText = "商品名称";
            this.CommName.Name = "CommName";
            this.CommName.ReadOnly = true;
            this.CommName.Resizable = DataGridViewTriState.True;
            this.CommName.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.StandardMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.StandardMoney.HeaderText = "标准价";
            this.StandardMoney.Name = "StandardMoney";
            this.StandardMoney.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.Discount.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Discount.HeaderText = "折扣";
            this.Discount.Name = "Discount";
            this.Discount.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.AmoutMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.AmoutMoney.HeaderText = "折后价";
            this.AmoutMoney.Name = "AmoutMoney";
            this.AmoutMoney.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.Amount.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Amount.DataPropertyName = "Amount";
            this.Amount.FillWeight = 90f;
            this.Amount.HeaderText = "数量";
            this.Amount.Name = "Amount";
            this.Amount.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.AllMoneys.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.AllMoneys.HeaderText = "总价";
            this.AllMoneys.Name = "AllMoneys";
            this.AllMoneys.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.AmountUnit.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.AmountUnit.DataPropertyName = "AmountUnit";
            style9.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.AmountUnit.DefaultCellStyle = style9;
            this.AmountUnit.FillWeight = 90f;
            this.AmountUnit.HeaderText = "单位";
            this.AmountUnit.Name = "AmountUnit";
            this.AmountUnit.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.Remark.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Remark.DataPropertyName = "Remark";
            style10.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style10.BackColor = Color.White;
            this.Remark.DefaultCellStyle = style10;
            this.Remark.FillWeight = 150f;
            this.Remark.HeaderText = "商品规格";
            this.Remark.Name = "Remark";
            this.Remark.SortMode = DataGridViewColumnSortMode.NotSortable;
            this.IsZs.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.IsZs.HeaderText = "赠送";
            this.IsZs.Name = "IsZs";
            this.IsZs.Resizable = DataGridViewTriState.True;
            this.IsZs.SortMode = DataGridViewColumnSortMode.NotSortable;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x390, 0x227);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            base.FormBorderStyle = FormBorderStyle.None;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FrmOrdersVeiw";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            ((ISupportInitialize) this.DataGridList).EndInit();
            this.pan_Table3.ResumeLayout(false);
            this.pan_Table3.PerformLayout();
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.pan_Table4.ResumeLayout(false);
            this.pan_td11.ResumeLayout(false);
            this.pan_td11.PerformLayout();
            this.pan_td10.ResumeLayout(false);
            this.pan_td9.ResumeLayout(false);
            this.pan_td9.PerformLayout();
            this.pan_td8.ResumeLayout(false);
            this.pan_Table2.ResumeLayout(false);
            this.pan_td3.ResumeLayout(false);
            this.pan_td3.PerformLayout();
            this.pan_td2.ResumeLayout(false);
            this.pan_td1.ResumeLayout(false);
            this.pan_td1.PerformLayout();
            this.pan_td0.ResumeLayout(false);
            this.panel_BiTian.ResumeLayout(false);
            this.panel_BiTian.PerformLayout();
            this.panel_Button.ResumeLayout(false);
            this.pan_Top.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void LoadSalesDeticl()
        {
            DataTable list = OrdersCommBll.GetList("OrdersId=" + this.orderId);
            foreach (DataRow row in list.Rows)
            {
                CommEnt model = CommBll.GetModel(int.Parse(row["CommId"].ToString()));
                CommTypeEnt ent2 = null;
                if (model != null)
                {
                    ent2 = CommTypeBll.GetModel(model.CommTypeId);
                }
                this.DataGridList.Rows.Add();
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[1].Value = row["LotNum"].ToString();
                if (ent2 != null)
                {
                    this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[2].Value = ent2.CommTypeName;
                }
                if (model != null)
                {
                    this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[3].Value = model.CommName;
                }
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[4].Value = decimal.Parse(row["StandardMoney"].ToString()).ToString("F2");
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[5].Value = row["Discount"].ToString();
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[6].Value = decimal.Parse(row["AmoutMoney"].ToString()).ToString("F2");
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[7].Value = decimal.Parse(row["Amount"].ToString()).ToString("F2");
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[8].Value = decimal.Parse(row["AmoutMoney"].ToString()) * decimal.Parse(row["Amount"].ToString());
                ParameterEnt ent3 = ParameterBll.GetModel(int.Parse(row["AmoutUnit"].ToString()));
                if (ent3 != null)
                {
                    this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[9].Value = ent3.ParName;
                }
                this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[10].Value = row["Remark"].ToString();
                if (row["IsGiveGuestPresent"].ToString() == "1")
                {
                    this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[11].Value = "√";
                }
                else
                {
                    this.DataGridList.Rows[this.DataGridList.Rows.Count - 1].Cells[11].Value = "";
                }
            }
            this.fh.TotalRow(this.DataGridList, 8, "IsZs");
        }

        private void pan_Table3_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_Table3, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void pan_td0_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td0, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td1_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td1, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td10_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td10, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td11_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td11, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td2_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td2, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td3_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td3, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td8_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td8, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td9_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td9, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void panel_BiTian_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_BiTian, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void panel_Button_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_Button, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void Panel_ResetPaint(PaintEventArgs e, Panel panel, Color color, int leftBoder, int topBoder, int rightBoder, int bottomBoder)
        {
            ControlPaint.DrawBorder(e.Graphics, panel.ClientRectangle, color, leftBoder, ButtonBorderStyle.Solid, color, topBoder, ButtonBorderStyle.Solid, color, rightBoder, ButtonBorderStyle.Solid, color, bottomBoder, ButtonBorderStyle.Solid);
        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel1, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 0);
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
    }
}

